package api

import (
	"github.com/gin-gonic/gin"
	"zy4/api/handler"
	"zy4/api/middle"
	"zy4/pkg"
)

func Router(r *gin.Engine) {
	r.Use(middle.RunTime())
	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			user.POST("/login", handler.Login)
		}
		gift := api.Group("/gift")
		{
			gift.Use(pkg.JWTAuth("2210a"))
			gift.POST("/add", handler.AddGift)
			gift.POST("/update", handler.UpdateGift)
			gift.POST("/remove", handler.RemoveGift)
			gift.POST("/manygift", handler.ManyGift)
		}
	}
}
